package cn.dev.admin;

import cn.dev.admin.constant.MqConstant;
import cn.dev.admin.holder.MqHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author japhet_jiu
 * @version 1.0
 */

@RestController
@RequestMapping("rabbitmq")
@Slf4j
public class MQController {

    @Autowired
    private MqHolder mqHolder;


    @GetMapping("sendMsg")
    public String sendMsg() {
        //正常的生产者
        mqHolder.sendMessage(MqConstant.QUEUE_TEST_HELLO, "hello japhet_jiu");
        return "";
    }

    @GetMapping("synCaseToEsQueue")
    public String synCaseToEsQueue() {
        //正常的生产者
        mqHolder.sendMessage( MqConstant.SYN_CASE_TO_ES_QUEUE, "synCaseToEsQueue");
        return "";
    }

}
